package com.mdl.api.controller;

import com.mdl.mall.dto.UserDto;
import com.mdl.api.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Desc
 * @Author madengling
 * @Time 2020/9/17 16:55
 */
@RestController
@RequestMapping(value = "/user")
public class UserController {
    private static final Logger log = LoggerFactory.getLogger(UserController.class);
    @Autowired
    UserService userService;

//    @RequestMapping("getUser/{id}")
//    public String getUser(@PathVariable int id){
//        User user = userService.getUser(id);
//        log.info(user.getName());
//        return user.getName();
//    }

    @RequestMapping(value = "/login")
    public UserDto login(){
//        if(!StringUtils.isEmpty(user.getUsername()) && "123456".equals(user.getPassword())){
//            return "success";
//        }
        UserDto userDto = new UserDto();
        userDto.setUsername("测试");
        userDto.setSex("男");
        userDto.setTelephone("13678807723");
        return userDto;
    }

}
